<!DOCTYPE html>
<html style="height: 100%">

<head>
	<meta charset="UTF-8">
	<title></title>
	<style>
		body {
			margin: 0;
			padding: 0;
			/*width: 100%;*/
			height: 100%;
		}

		.topdiv {
			width: 100%;
			height: 90px;
			background: rgba(0, 0, 0, 0.5);
			color: white;
			text-align: center;
		}

		.topleftdiv {
			float: left;
			width: 33%;
			margin: auto;
			text-align: center;
		}

		.toprightdiv {
			float: right;
			width: 33%;
			margin: auto;
			text-align: center;
		}

		.leftdiv {
			float: left;
			/*display: inline-block;*/
			margin-top: 2%;
			width: 70%;
			/*margin-right: 8%;*/
			height: 80%;
		}

		.rightdiv {
			/*float: right;*/
			position: absolute;
			/*top: 2%;*/
			right: 0%;
			width: 30%;
			height: 70%;
			/*z-index: 99;*/
		}
	</style>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
	<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/simplex.js"></script>
	<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
	<script src="../js/config.js"></script>
</head>

<body>



	<div class="topdiv">
		<div class="topleftdiv">
			<p id="todaymoeny">0.00</p>
			<p>今日交易额</p>
		</div>
		<div class="topleftdiv">
			<p id="zhoumoeny">0.00</p>
			<p>本周交易额</p>
		</div>
		<div class="toprightdiv">
			<p id="allmoeny">0.00</p>
			<p>交易总额</p>
		</div>
	</div>





	<div class="leftdiv">
		<div id="containerleft" style="height: 100%;"></div>
	</div>
	<div class="rightdiv">
		<div id="containerright" style="height: 100%;"></div>
	</div>

	<script src="js/cookie.js" type="text/javascript" charset="utf-8"></script>

	<script type="text/javascript">
		// 获取页面总数据
		$(function () {
			var account = $.cookie('user__userName');
			var md5 = $.cookie('user__code');
			$.ajax({
				type: 'POST',
				url: $.webConfig.basicUrl + '/chuyangPay/user/getUserDB',
				data: {
					account: account,
					md5: md5
				},
				dataType: "json",
				success: function (data) {
					if (data['code'] == 200) {
						console.log(data);
						if (data['code'] == 200) {
							$('#allmoeny').text(data['data']['merchantTotal']);
							$('#zhoumoeny').text(data['data']['zhouOrderSum']);
							$('#todaymoeny').text(data['data']['tianOrderSum']);
						}
					} else {
						layer.alert(data['msc']);
					}
				},
				error: function (err) {
					console.log(err);
				}
			})
		});




		var dom = document.getElementById("containerleft");
		var myChartz = echarts.init(dom);
		var app = {};
		option = null;
		option = {
			title: {
				text: '近7日交易金额'
			},
			tooltip: {
				trigger: 'axis',
				axisPointer: { // 坐标轴指示器，坐标轴触发有效
					type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
				}
			},
			legend: {
				data: ['支付宝', '微信', '其他']
			},
			grid: {
				left: '3%',
				right: '4%',
				bottom: '3%',
				containLabel: true
			},
			//  toolbox: {
			//      feature: {
			//          saveAsImage: {}
			//      }
			//  },
			xAxis: {
				type: 'category',
				data: ['1', '2', '3', '4', '5', '6', '7']
			},
			yAxis: {
				type: 'value'
			},
			series: [{
					name: '支付宝',
					type: 'bar',
					data: [120, 132, 101, 134, 90, 230, 210]
				},
				{
					name: '微信',
					type: 'bar',
					data: [220, 282, 201, 234, 290, 430, 410]
				},
				{
					name: '其他',
					type: 'bar',
					data: [450, 432, 401, 454, 590, 530, 510]
				}
			]
		};
		if (option && typeof option === "object") {
			myChartz.setOption(option, true);
		}

		var dom = document.getElementById("containerright");
		var myChart = echarts.init(dom);
		var app = {};
		option = {
			tooltip: {
				trigger: 'item',
				formatter: "{a} <br/>{b} : {c} ({d}%)"
			},
			calculable: true,
			series: [{
				name: '交易金额',
				type: 'pie',
				radius: [20, 150],
				roseType: 'area',
				data: [{
						value: 10,
						name: '支付宝'
					},
					{
						value: 5,
						name: '微信'
					},
					{
						value: 15,
						name: '其他'
					}
				]
			}]
		};
		if (option && typeof option === "object") {
			myChart.setOption(option, true);
		}
		window.todaynum = 0;
		// $(function () {
		// 	$.ajax({
		// 		type: 'POST',
		// 		url: $.webConfig.basicUrl + '/chuyangPay/order/getWeekData',
		// 		dataType: "json",
		// 		success: function (data) {
		// 			if (data['return_code'] == 1) {
		// 				console.log(data);
		// 				myChartz.setOption({
		// 					legend: {
		// 						data: [data['return_body']['1']['0']['orderType'], data['return_body']['0']['0']['orderType'], data[
		// 							'return_body']['2']['0']['orderType']]
		// 					},
		// 					xAxis: {
		// 						data: [data['return_body']['0']['0']['orderTime'], data['return_body']['0']['1']['orderTime'], data[
		// 								'return_body']['0']['2']['orderTime'], data['return_body']['0']['3']['orderTime'], data['return_body']
		// 							['0']['4']['orderTime'], data['return_body']['0']['5']['orderTime'], data['return_body']['0']['6'][
		// 								'orderTime'
		// 							]
		// 						]
		// 					},
		// 					series: [{
		// 							name: data['return_body']['1']['0']['orderType'],
		// 							type: 'bar',
		// 							data: [data['return_body']['1']['0']['orderNum'], data['return_body']['1']['1']['orderNum'], data[
		// 									'return_body']['1']['2']['orderNum'], data['return_body']['1']['3']['orderNum'], data['return_body']
		// 								['1']['4']['orderNum'], data['return_body']['1']['5']['orderNum'], data['return_body']['1']['6'][
		// 									'orderNum'
		// 								]
		// 							]
		// 						},
		// 						{
		// 							name: data['return_body']['0']['0']['orderType'],
		// 							type: 'bar',
		// 							data: [data['return_body']['0']['0']['orderNum'], data['return_body']['0']['1']['orderNum'], data[
		// 									'return_body']['0']['2']['orderNum'], data['return_body']['0']['3']['orderNum'], data['return_body']
		// 								['0']['4']['orderNum'], data['return_body']['0']['5']['orderNum'], data['return_body']['0']['6'][
		// 									'orderNum'
		// 								]
		// 							]
		// 						},
		// 						{
		// 							name: data['return_body']['2']['0']['orderType'],
		// 							type: 'bar',
		// 							data: [data['return_body']['2']['0']['orderNum'], data['return_body']['2']['1']['orderNum'], data[
		// 									'return_body']['2']['2']['orderNum'], data['return_body']['2']['3']['orderNum'], data['return_body']
		// 								['2']['4']['orderNum'], data['return_body']['2']['5']['orderNum'], data['return_body']['2']['6'][
		// 									'orderNum'
		// 								]
		// 							]
		// 						}
		// 					]
		// 				});
		// 				todaynum = parseFloat(data['return_body']['1']['0']['orderNum']) + parseFloat(data['return_body']['0']['0'][
		// 					'orderNum'
		// 				]) + parseFloat(data['return_body']['2']['0']['orderNum']);
		// 				$("#todaymoeny").html(todaynum);
		// 			} else {
		// 				layer.alert(data['return_msg']);
		// 			}
		// 		},
		// 		error: function (err) {
		// 			console.log(err);
		// 		}
		// 	});


		// 	window.allnum = 0;
		// 	$.ajax({
		// 		type: 'POST',
		// 		url: $.webConfig.basicUrl + '/chuyangPay/order/getOrderNumAndOrderType',
		// 		dataType: "json",
		// 		success: function (data) {
		// 			if (data['return_code'] == 1) {
		// 				console.log(data);
		// 				myChart.setOption({
		// 					series: [{
		// 						data: [{
		// 								value: data['return_body']['0']['orderNum'],
		// 								name: data['return_body']['0']['orderType']
		// 							},
		// 							{
		// 								value: data['return_body']['1']['orderNum'],
		// 								name: data['return_body']['1']['orderType']
		// 							},
		// 							{
		// 								value: data['return_body']['2']['orderNum'],
		// 								name: data['return_body']['2']['orderType']
		// 							}
		// 						]
		// 					}]
		// 				});
		// 				allnum = parseFloat(data['return_body']['0']['orderNum']) + parseFloat(data['return_body']['1']['orderNum']) +
		// 					parseFloat(data['return_body']['2']['orderNum']);
		// 				allnum = allnum.toFixed(2);
		// 				$("#allmoeny").html(allnum);
		// 			} else {
		// 				layer.alert(data['return_msg']);
		// 			}
		// 		},
		// 		error: function (err) {
		// 			console.log(err);
		// 		}
		// 	});

		// })
	</script>
</body>

</html>